package com.study01;

public class LoginDemo {
    public static Boolean matchName(String[] nameArr,String name ) throws NameException {
        for (String everyName:nameArr) {
            if(everyName.equals(name) ){
                throw new NameException("这个名字重复");
            }
        }
        return true;
    }
    public static void main(String[] args) {
        String[] ln ={"张三","李四"};
        try {
            Boolean result = matchName(ln, "张三");
            System.out.println(result);
        } catch (NameException e) {
            e.printStackTrace();
        }

    }
}
